package edu.jptest.serviceImp;

import edu.jptest.bean.Answer;
import edu.jptest.dao.AnswerDAO;
import edu.jptest.service.IAnswerService;

public class AnswerService implements IAnswerService {

	// 插入答案�����
	public boolean addAnswer(Answer answer) {
		AnswerDAO answerDao = new AnswerDAO();
		return answerDao.insertAnswer(answer);
	}

	// 删除答案
	public boolean deleteAnswer(int answerId) {
		AnswerDAO answerDao = new AnswerDAO();
		return answerDao.deleteAnswer(answerId);
	}

	// 修改答案��Ĵ�
	public boolean modifyAnswer(Answer answer) {
		AnswerDAO answerDao = new AnswerDAO();
		return answerDao.updateAnswer(answer);
	}

	// ͨ���id����通过答案id，查询答案对象�𰸶���
	public Answer getAnswerByAnswerId(int answerId) {
		AnswerDAO answerDao = new AnswerDAO();
		return answerDao.getAnswerByAnswerId(answerId);
	}

	// 通过答案内容，查询答案ID
	public int getAnswerIdByAnswer(Answer answer) {
		AnswerDAO answerDao = new AnswerDAO();
		return answerDao.getAnswerIdByAnswer(answer);
	}

}
